import { ApiProperty } from '@nestjs/swagger';
import { Column, Entity } from 'typeorm';
import { BaseEntity } from '../../../base.entity';

@Entity({ name: 'wip_alarm_record' })
export default class WipAlarmRecord extends BaseEntity {
  @Column({
    type: 'varchar',
    unique: true,
    length: 50,
    name: 'alarm_record_code',
    comment: '报警登记编号',
  })
  @ApiProperty()
  alarmRecordCode: string;

  @Column({
    type: 'varchar',
    nullable: true,
    length: 50,
    name: 'alarm_status_code',
    comment: '报警状态编码',
  })
  @ApiProperty()
  alarmStatusCode: string;

  @Column({
    type: 'varchar',
    nullable: true,
    length: 100,
    name: 'machine_code',
    comment: '设备编码',
  })
  @ApiProperty()
  machineCode: string;

  @Column({ type: 'varchar', nullable: true, length: 50, name: 'alarm_code', comment: '报警编码' })
  @ApiProperty()
  alarmCode: string;

  @Column({ type: 'varchar', nullable: true, length: 100, name: 'alarm_name', comment: '报警名称' })
  @ApiProperty()
  alarmName: string;

  @Column({ type: 'varchar', length: 100, name: 'alarm_area', comment: '报警区域', nullable: true })
  @ApiProperty()
  alarmArea: string;

  @Column({
    type: 'varchar',
    nullable: true,
    length: 100,
    name: 'alarm_type_code',
    comment: '报警类型编码',
  })
  @ApiProperty()
  alarmTypeCode: string;

  @Column({
    type: 'datetime',
    nullable: true,
    name: 'occur_time',
    comment: '发生时间',
  })
  @ApiProperty()
  occurTime: Date;

  @Column({ type: 'datetime', nullable: true, name: 'close_time', comment: '关闭时间' })
  @ApiProperty()
  closeTime: Date;
}
